package com.op.studyingliteapp.activity;

import java.io.FileNotFoundException;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.widget.ImageView;

import com.op.studyingliteapp.R;

public class PictureActivity extends Activity {

	ImageView imageView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.avtivity_picture);
		showPicture();
	}
	
	public void showPicture(){
		try {
			imageView = (ImageView) findViewById(R.id.imgView); 
			Bundle bundle = getIntent().getExtras();
			Uri uri = bundle.getParcelable("uri");
			Bitmap bitmap= BitmapFactory.decodeStream( this.getContentResolver().openInputStream(uri));
			   
	          /* 将Bitmap设定到ImageView */    
	          imageView.setImageBitmap(bitmap);
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}    
          
	}

}
